
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Esmap地图详解 · 记录技术文档内容</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="zhengyuliang">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="npm镜像切换.html" />
    
    
    <link rel="prev" href="../technology/规范化git的提交信息.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">CSS</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../CSS/18种CSS命名和书写规范.html">
            
                <a href="../CSS/18种CSS命名和书写规范.html">
            
                    
                    18种CSS命名和书写规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../CSS/灵活运用CSS开发技巧.html">
            
                <a href="../CSS/灵活运用CSS开发技巧.html">
            
                    
                    灵活运用CSS开发技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../CSS/自适应 flex grid.html">
            
                <a href="../CSS/自适应 flex grid.html">
            
                    
                    自适应 Flex Grid
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">HTML</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../HTML/浏览器里的本地数据库：IndexedDB.html">
            
                <a href="../HTML/浏览器里的本地数据库：IndexedDB.html">
            
                    
                    浏览器里的本地数据库：IndexedDB
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Vue</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../Vue/7个有用的Vue开发技巧.html">
            
                <a href="../Vue/7个有用的Vue开发技巧.html">
            
                    
                    7个有用的Vue开发技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../Vue/Vue this.$router.push、replace、go的区别.html">
            
                <a href="../Vue/Vue this.$router.push、replace、go的区别.html">
            
                    
                    Vue This.$Router.Push、Replace、Go的区别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../Vue/Vue 的父组件和子组件生命周期钩子函数执行顺序？.html">
            
                <a href="../Vue/Vue 的父组件和子组件生命周期钩子函数执行顺序？.html">
            
                    
                    Vue 的父组件和子组件生命周期钩子函数执行顺序？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="../Vue/Vue.set和this.$set应用的场景.html">
            
                <a href="../Vue/Vue.set和this.$set应用的场景.html">
            
                    
                    Vue.Set和This.$Set应用的场景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="../Vue/vue高级技巧.html">
            
                <a href="../Vue/vue高级技巧.html">
            
                    
                    Vue高级技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="../Vue/从 0 开始手把手带你搭建一套规范的 Vue3.x 项目工程环境.html">
            
                <a href="../Vue/从 0 开始手把手带你搭建一套规范的 Vue3.x 项目工程环境.html">
            
                    
                    从 0 开始手把手带你搭建一套规范的 Vue3.X 项目工程环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="../Vue/浅析 vue-router 源码和动态路由权限分配.html">
            
                <a href="../Vue/浅析 vue-router 源码和动态路由权限分配.html">
            
                    
                    浅析 Vue Router 源码和动态路由权限分配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="../Vue/父组件监听到子组件的生命周期.html">
            
                <a href="../Vue/父组件监听到子组件的生命周期.html">
            
                    
                    父组件监听到子组件的生命周期
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="../Vue/理解Vue.mixin，利用Vue.mixin正确的偷懒.html">
            
                <a href="../Vue/理解Vue.mixin，利用Vue.mixin正确的偷懒.html">
            
                    
                    理解Vue.Mixin，利用Vue.Mixin正确的偷懒
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">JavaScript</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../javaScript/5个技巧让你更好的编写 JavaScript(ES6">
            
                <span>
            
                    
                    5个技巧让你更好的编写 JavaScript(ES6) 中条件语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../javaScript/5种常见函数的写法和调用方式.html">
            
                <a href="../javaScript/5种常见函数的写法和调用方式.html">
            
                    
                    5种常见函数的写法和调用方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../javaScript/7道javascript题，让你理解基本的javascript.html">
            
                <a href="../javaScript/7道javascript题，让你理解基本的javascript.html">
            
                    
                    7道Javascript题，让你理解基本的Javascript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="../javaScript/Array.from(">
            
                <span>
            
                    
                    Array.From() 五个超好用的用途
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="../javaScript/ES6汇总资料.html">
            
                <a href="../javaScript/ES6汇总资料.html">
            
                    
                    ES6汇总资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="../javaScript/JS开发必须知道的41个技巧.html">
            
                <a href="../javaScript/JS开发必须知道的41个技巧.html">
            
                    
                    JS开发必须知道的41个技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="../javaScript/JavaScript之防抖Debounce和节流Throttle.html">
            
                <a href="../javaScript/JavaScript之防抖Debounce和节流Throttle.html">
            
                    
                    JavaScript之防抖Debounce和节流Throttle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="../javaScript/JavaScript数组求并集，交集和差集.html">
            
                <a href="../javaScript/JavaScript数组求并集，交集和差集.html">
            
                    
                    JavaScript数组求并集，交集和差集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.9" data-path="../javaScript/JavaScript的优雅写法.html">
            
                <a href="../javaScript/JavaScript的优雅写法.html">
            
                    
                    JavaScript的优雅写法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.10" data-path="../javaScript/axios知识点.html">
            
                <a href="../javaScript/axios知识点.html">
            
                    
                    Axios知识点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.11" data-path="../javaScript/javascript核心知识.html">
            
                <a href="../javaScript/javascript核心知识.html">
            
                    
                    Javascript核心知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.12" data-path="../javaScript/this、apply、call、bind.html">
            
                <a href="../javaScript/this、apply、call、bind.html">
            
                    
                    This、Apply、Call、Bind
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.13" data-path="../javaScript/前端js常用的60余种工具方法.html">
            
                <a href="../javaScript/前端js常用的60余种工具方法.html">
            
                    
                    前端Js常用的60余种工具方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.14" data-path="../javaScript/前端异常的捕获与处理.html">
            
                <a href="../javaScript/前端异常的捕获与处理.html">
            
                    
                    前端异常的捕获与处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.15" data-path="../javaScript/在 JavaScript 中交换值的 10 种方法.html">
            
                <a href="../javaScript/在 JavaScript 中交换值的 10 种方法.html">
            
                    
                    在 JavaScript 中交换值的 10 种方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.16" data-path="../javaScript/常用的前端JavaScript方法封装.html">
            
                <a href="../javaScript/常用的前端JavaScript方法封装.html">
            
                    
                    常用的前端JavaScript方法封装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.17" data-path="../javaScript/异步神器Async-await介绍与填坑.html">
            
                <a href="../javaScript/异步神器Async-await介绍与填坑.html">
            
                    
                    异步神器Async Await介绍与填坑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.18" data-path="../javaScript/灵活运用JS开发技巧.html">
            
                <a href="../javaScript/灵活运用JS开发技巧.html">
            
                    
                    灵活运用JS开发技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.19" data-path="../javaScript/编写高质量可维护的代码：一目了然的注释.html">
            
                <a href="../javaScript/编写高质量可维护的代码：一目了然的注释.html">
            
                    
                    编写高质量可维护的代码：一目了然的注释
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.20" data-path="../javaScript/编写高质量可维护的代码：优化逻辑判断.html">
            
                <a href="../javaScript/编写高质量可维护的代码：优化逻辑判断.html">
            
                    
                    编写高质量可维护的代码：优化逻辑判断
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.21" data-path="../javaScript/编写高质量可维护的代码：优雅命名.html">
            
                <a href="../javaScript/编写高质量可维护的代码：优雅命名.html">
            
                    
                    编写高质量可维护的代码：优雅命名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.22" data-path="../javaScript/编写高质量可维护的代码：数据建模.html">
            
                <a href="../javaScript/编写高质量可维护的代码：数据建模.html">
            
                    
                    编写高质量可维护的代码：数据建模
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Life Exp</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../life_exp/告别平庸的15个小方法.html">
            
                <a href="../life_exp/告别平庸的15个小方法.html">
            
                    
                    告别平庸的15个小方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../life_exp/日志记录.html">
            
                <a href="../life_exp/日志记录.html">
            
                    
                    日志记录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="../life_exp/程序员的发展方向.html">
            
                <a href="../life_exp/程序员的发展方向.html">
            
                    
                    程序员的发展方向
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="../message/">
            
                <a href="../message/">
            
                    
                    Message
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Technology</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../technology/WebSocket.html">
            
                <a href="../technology/WebSocket.html">
            
                    
                    WebSocket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../technology/npm常用命令大全.html">
            
                <a href="../technology/npm常用命令大全.html">
            
                    
                    Npm常用命令大全
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="../technology/智能照明项目说明.html">
            
                <a href="../technology/智能照明项目说明.html">
            
                    
                    智能照明项目说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="../technology/规范化git的提交信息.html">
            
                <a href="../technology/规范化git的提交信息.html">
            
                    
                    规范化Git的提交信息
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Tutorial</li>
        
        
    
        <li class="chapter active" data-level="7.1" data-path="Esmap地图详解.html">
            
                <a href="Esmap地图详解.html">
            
                    
                    Esmap地图详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="npm镜像切换.html">
            
                <a href="npm镜像切换.html">
            
                    
                    Npm镜像切换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="发布npm的教程.html">
            
                <a href="发布npm的教程.html">
            
                    
                    发布Npm的教程
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Esmap地图详解</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <html><head></head><body><div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><ul><li><span class="title-icon "></span><a href="#esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;&#x8BE6;&#x89E3;"><b>1.1. </b>ESMap&#x5BA4;&#x5185;&#x5730;&#x56FE;&#x8BE6;&#x89E3;</a></li><ul><li><span class="title-icon "></span><a href="#&#x4E00;&#xFF1A;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;"><b>1.1.1. </b>&#x4E00;&#xFF1A;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;</a></li><li><span class="title-icon "></span><a href="#&#x4E8C;&#xFF1A;-vue&#x52A0;&#x8F7D;esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;"><b>1.1.2. </b>&#x4E8C;&#xFF1A; vue&#x52A0;&#x8F7D;ESMap&#x5BA4;&#x5185;&#x5730;&#x56FE;</a></li></ul></ul></ul></div><a href="#" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h2 id="esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;&#x8BE6;&#x89E3;"><a name="esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;&#x8BE6;&#x89E3;" class="anchor-navigation-ex-anchor" href="#esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;&#x8BE6;&#x89E3;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. ESMap&#x5BA4;&#x5185;&#x5730;&#x56FE;&#x8BE6;&#x89E3;</h2>
<blockquote>
<p>&#x56E0;&#x533B;&#x7597;&#x7CFB;&#x7EDF;&#x63A5;&#x89E6;ESMap&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;&#xFF0C;&#x76EE;&#x524D;&#x5927;&#x6982;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B;ESMap&#x4F7F;&#x7528;&#x60C5;&#x51B5;</p>
</blockquote>
<h3 id="&#x4E00;&#xFF1A;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;"><a name="&#x4E00;&#xFF1A;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;" class="anchor-navigation-ex-anchor" href="#&#x4E00;&#xFF1A;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.1. &#x4E00;&#xFF1A;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;</h3>
<p>ESMap&#x6700;&#x4E3B;&#x8981;&#x5C31;&#x662F;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;&#xFF0C;&#x6CA1;&#x6709;&#x5185;&#x5BB9;&#x7684;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;&#xFF0C;SDK&#x5F00;&#x53D1;&#x5C31;&#x4E0D;&#x4ECE;&#x8C08;&#x8D77;&#x3002;&#x5730;&#x56FE;&#x7F16;&#x8F91;&#x5668;&#x5982;&#x4E0B;&#x56FE;</p>
<blockquote>
<p>&#x5305;&#x62EC;&#x623F;&#x95F4;&#x7F16;&#x8F91;&#xFF0C;&#x6A21;&#x578B;&#x5E93;&#xFF0C;POI&#x7F16;&#x8F91;&#xFF0C;&#x5BFC;&#x822A;&#x7F16;&#x8F91;&#xFF0C;&#x697C;&#x5C42;&#x7F16;&#x8F91;&#x7B49;</p>
</blockquote>
<h3 id="&#x4E8C;&#xFF1A;-vue&#x52A0;&#x8F7D;esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;"><a name="&#x4E8C;&#xFF1A;-vue&#x52A0;&#x8F7D;esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;" class="anchor-navigation-ex-anchor" href="#&#x4E8C;&#xFF1A;-vue&#x52A0;&#x8F7D;esmap&#x5BA4;&#x5185;&#x5730;&#x56FE;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.2. &#x4E8C;&#xFF1A; vue&#x52A0;&#x8F7D;ESMap&#x5BA4;&#x5185;&#x5730;&#x56FE;</h3>
<blockquote>
<p>SDK&#x76EE;&#x524D;&#x4E0D;&#x652F;&#x6301;&#x7528;require js&#x5F15;&#x7528;&#xFF0C;&#x53EA;&#x80FD;&#x4F7F;&#x7528;<script src="lib/esmap.min.js">&lt;/script &gt;引用</p>
</blockquote>
<ol>
<li><p>Vue-cli3加载地图vue-cli3没有 <strong>static</strong> 文件夹，而使用 <strong>public</strong> 文件夹代替。其余操作步骤同vue-cli2，详见如下</p>
</li>
<li><p>Vue-cli2加载地图步骤</p>
<h5>第一步:把esmap.min.js文件、地图相应的图标、地图文件、主题文件放在根目录 /static 文件夹下。</h5>
</li>
</ol>
<pre><code class="lang-vue">// 第二步:在 index.html 文件下引入esmap sdk
&lt;body&gt;
  &lt;div id=&quot;app&quot;&gt; &lt;/div&gt;
  &lt;script src=&quot;./static/esmap/esmap.min.js&quot;&gt; &lt;/script&gt;
  &lt;!-- built files will be auto injected --&gt;
&lt;/body&gt;

// 第三步:创建一个单独的地图容器组件
&lt;template&gt;
  &lt;div id=&quot;map-container&quot;&gt;&lt;/div&gt;
&lt;/template&gt;
</code></pre>
<pre><code class="lang-javascript">// 第四步:组件挂载完成后初始化地图
export default {
  name: &quot;MapContainer&quot;,
  mounted() {
    window.map = new esmap.ESMap({
      container: document.getElementById(&quot;map-container&quot;),
      //如果地图、主题文件放在static目录下，请使用static路径
      mapDataSrc: &quot;/esmap/data&quot;,
      mapThemeSrc: &quot;/esmap/data/theme&quot;
      // themeID: defaultOpt.themeID,
      // token: &#39;escope&#39;
    });
    map.openMapById(10001);

    var ctlOpt = new esmap.ESControlOptions({
      position: esmap.ESControlPositon.RIGHT_TOP,
      //注意：imgURL参数是static目录下图片的路径
      imgURL: &quot;static/esmap/resource/style/wedgets/img/&quot; 
    });

    map.on(&quot;loadComplete&quot;, function() {
      //创建楼层控件
      var floorControl = new esmap.ESScrollFloorsControl(map, ctlOpt);

    });
  }
};
</code></pre>
<h3>三：SDK开发编辑</h3>
<p>地图初始化配置详情</p>
<pre><code class="lang-javascript">var map = new esmap.ESMap({
    container: document.getElementById(&#39;map-container&#39;),  //地图显示容器
    mapDataSrc: &#39;/data/&#39;,               //离线地图数据位置
    mapThemeSrc: &#39;/data/theme/&#39;,        //离线主题数据位置
    focusAlphaMode: true,               //对不可见图层启用透明设置 默认为true
    focusAnimateMode: false,            //开启聚焦层切换的动画显示
    focusAlpha: 0.1,                    //对不聚焦图层启用透明设置，当focusAlphaMode = true时有效
    viewModeAnimateMode: false,         //开启2维，3维切换的动画显示
    moveToAnimateMode: false,           //地图定位跳转动画设置
    defaultScaleLevel: 12,              //设置默认显示级别,1到24之间的整数
    modelSelectedEffect: true,          //支持单击模型高亮，false为单击时模型不高亮
    visibleFloors: [1,2,3],             //初始显示楼层
    focusFloor: 1,                      //初始聚焦楼层
    themeID: &#39;2001&#39;,                    //自定义样式主题ID
    token:&#39;&#39;,                            //打开地图对应的token
    viewMode: esmap.ESViewMode.MODE_3D     //初始二维还是三维状态
});
</code></pre>
<blockquote>
<p>map一定要设置为全局对象，window.map =这样来赋值初始化，不然其它函数报map未定义.</p>
</blockquote>
<p>如： </p>
<pre><code class="lang-javascript">// 初始化内容
const esmap = window.esmap // 赋值初始化
const container = document.getElementById(&#39;map-container&#39;)
    this.map = new esmap.ESMap({
      container: container, // 渲染dom
      mapDataSrc: configMapOpt.mapDataSrc, // 地图数据位置
      mapThemeSrc: configMapOpt.mapThemeSrc, // 主题数据位置
      // visibleFloors: &#39;all&#39;,//更多初始化参数配置请参考https://www.esmap.cn/escopemap/content/cn/develope/map-config.html
      // focusFloor: 1,
      // viewModeAnimateMode: false,
      defaultScaleLevel: 4,
      viewMode: esmap.ESViewMode.MODE_2D,
      token: configMapOpt.mapToken
    })
    // 打开地图数据
    this.map.openMapById(configMapOpt.mapID)
    this.map.showCompass = true // 显示指南针
</code></pre>
<pre><code class="lang-javascript"> // 增加标签
    addMarker ({ x, y, name, img, floorNum = 1, RoomHigh = 0.1 }) {
      const _that = this
      // _that.remove()
      const floor = _that.map.getFloor(floorNum)
      const layer = new esmap.ESLayer(
        esmap.ESLayerType.IMAGE_MARKER,
        &#39;myImageMarkers&#39;
      )
      floor.addLayer(layer)
      this.floor = floor
      const tm = new esmap.ESImageMarker({
        x: x,
        y: y,
        name: name,
        size: 48,
        height: RoomHigh,
        spritify: true,
        seeThrough: true,
        url: img
      })
      this.tag = tm
      layer.addMarker(tm)
      this.layer = layer
    }
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright &copy zhengyuliang all right reserved，powered by Gitbook</span><span class="footer-modification">该文件编写时间：
2020-07-29 08:03:29
</span></footer></script></p></blockquote></body></html>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../technology/规范化git的提交信息.html" class="navigation navigation-prev " aria-label="Previous page: 规范化Git的提交信息">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="npm镜像切换.html" class="navigation navigation-next " aria-label="Next page: Npm镜像切换">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Esmap地图详解","level":"7.1","depth":1,"next":{"title":"Npm镜像切换","level":"7.2","depth":1,"path":"tutorial/npm镜像切换.md","ref":"tutorial/npm镜像切换.md","articles":[]},"previous":{"title":"规范化Git的提交信息","level":"6.4","depth":1,"path":"technology/规范化git的提交信息.md","ref":"technology/规范化git的提交信息.md","articles":[]},"dir":"ltr"},"config":{"plugins":["sectionx","splitter","tbfed-pagefooter","toggle-chapters","theme-comscore","-lunr","-search","search-plus","donate","anchor-navigation-ex","expandable-chapters","chapter-fold","expandable-chapters-small","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy zhengyuliang","modify_label":"该文件编写时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"pluginsConfig":{"anchor-navigation-ex":{"showLevel":false,"showGoTop":true,"isRewritePageTitle":true,"isShowTocTitleIcon":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"}},"livereload":{},"splitter":{},"donate":{"title":"","button":"赏","wechat":"https://gitee.com/htzyl/img_bed/raw/master/pay/weixin-min.jpg","alipay":"https://gitee.com/htzyl/img_bed/raw/master/pay/alipay-min.jpg","wechatText":"微信打赏","alipayText":"支付宝打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"sectionx":{"tag":"b"},"highlight":{},"anchor-navigation-ex":{"showLevel":true,"associatedWithSummary":true,"mode":"float","showGoTop":true,"printLog":false,"multipleH1":true,"float":{"floatIcon":"fa fa-navicon","showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""},"pageTop":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""}},"theme-comscore":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"zhengyuliang","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"记录技术文档内容","language":"zh-hans","gitbook":">=3.0.0","description":"记录Gitbook的配置和一些插件的使用","theme-default":{"showLevel":true}},"file":{"path":"tutorial/Esmap地图详解.md","mtime":"2020-07-29T00:03:29.329Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-01-06T09:44:01.178Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

